package day9;

import java.beans.beancontext.BeanContext;
import java.util.ArrayList;
import java.util.Scanner;

import org.junit.Test;

public class Demo {
	
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		ArrayList<Student> list = new ArrayList<Student>();
		for (;;) {
			System.out.println("请输入id：");
			int id = scanner.nextInt();
			System.out.println("请输入名字：");
			String name = scanner.next();
			System.out.println("请输入年龄：");
			int age = scanner.nextInt();
			System.out.println("请输入班级名字：");
			String className = scanner.next();
			
			// 每次循环构造一个Student对象
			Student student = new Student(id, name, age, className);
			// 把构造的学生对象放到指定下标位置
			list.add(student);
			
			System.out.println("是否继续输入：0退出，其他继续输入");
			int quit = scanner.nextInt();
			if (quit == 0) {
				break;
			}
		}
	}
}
